Cost sensitive browser cache cleanup

ABSTRACT

For browser cache cleanup, to consider for eviction a data item stored in a cache of a browser application in a device, a probability that the data item will be needed again during a period after the eviction is computed. A type is determined of a network that will be available at the device during the period. A cost is computed of obtaining the data item over a network of the type, from a location of the device during the period. Using the probability and the cost, a weight of the data item is computed. The weight is associated with the data item as a part of associating a set of weights with a set of data items in the cache. The data item is selected for eviction from the cache because the weight is a lowest weight in the set of weights.

TECHNICAL FIELD

The present invention relates generally to a method, system, andcomputer program product for managing a browser cache in data processingsystems. More particularly, the present invention relates to a method,system, and computer program product for cost sensitive browser cachecleanup.

BACKGROUND

A browser is a software application that executes on a data processingsystem and provides an interface through which a user or anotherapplication can request and receive content. For example, a user caninput a Uniform Resource Locator (URL) of a website into a browser, thebrowser accesses a server of the website corresponding to the URL,receives content from the server, and presents the content to the user.As another example, an application invokes a browser to use the browseras an interface to receive inputs into the application and to providethe application outputs.

A browser maintains a cache. A browser cache is a portion of a localstorage at the data processing system where the browser is executing, inwhich the browser saves content items (items) that the browser expectsto reuse. For example, if a user accesses a particular website everyday, the browser may save some graphical images from the website contentinto the browser cache so that the browser does not have to spend timeobtaining the graphics repeatedly at each access to the website.

A browser cache enables the browser to improve a user experience bylocally supplying some previously saved items locally without thelatency of data communications over data networks in obtaining thoseitems. As an example, by using a browser cache, the browser can load awebpage faster because only a part of the webpage has to be obtainedfrom a server over a network, and the remaining part is reused from thebrowser cache at the local data processing system. As another example, abrowser can cache the inputs supplied by a user during a previous use ofa form, and auto-fill the form by reusing the cached inputs during asubsequent access to the form.

Browsers also execute in mobile devices, such as smartphones, tabletcomputers, and wearable devices. Presently, the amount of computingresources, including an amount of data storage space, that is availableon mobile devices is significantly less than the amount of comparablecomputing resources that is available on other data processing systems.Consequently, although a browser can maintain a browser cache on amobile device, the size of the browser cache is significantly smallerthan on other data processing systems, such as laptop and desktopcomputers.

SUMMARY

The illustrative embodiments provide a method, system, and computerprogram product for cost sensitive browser cache cleanup. An embodimentincludes a method for browser cache cleanup. The embodiment computes,using a processor and a memory of a device, to consider for eviction adata item stored in a cache of a browser application, a probability thatthe data item will be needed again during a period after the eviction.The embodiment determines a type of a data network that will beavailable at the device during the period. The embodiment computes, acost of obtaining the data item over a data network of the type of datanetwork, from a location of the device during the period. The embodimentcomputes, using the probability that the data item will be needed againduring the period, and further using the cost of obtaining the data itemover the data network, a weight of the data item. The embodimentassociates the weight with the data item as a part of associating a setof weights with a set of data items in the cache. The embodiment selectsfor eviction from the cache the data item because the weight is a lowestweight in the set of weights.

Another embodiment includes a computer usable program product comprisinga computer readable storage device including computer usable code forbrowser cache cleanup.

Another embodiment includes a data processing system for browser cachecleanup.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

The novel features believed characteristic of the invention are setforth in the appended claims. The invention itself, however, as well asa preferred mode of use, further objectives and advantages thereof, willbest be understood by reference to the following detailed description ofthe illustrative embodiments when read in conjunction with theaccompanying drawings, wherein:

FIG. 1 depicts a block diagram of a network of data processing systemsin which illustrative embodiments may be implemented;

FIG. 2 depicts a block diagram of a data processing system in whichillustrative embodiments may be implemented;

FIG. 3 depicts a block diagram of an example progression in a processfor cost sensitive browser cache cleanup in accordance with anillustrative embodiment;

FIG. 4 depicts a block diagram of an example configuration of anapplication for cost sensitive browser cache cleanup in accordance withan illustrative embodiment;

FIG. 5 depicts a block diagram of an example process for training acached item weighting model in accordance with an illustrativeembodiment; and

FIG. 6 depicts a flowchart of an example process for cost sensitivebrowser cache cleanup in accordance with an illustrative embodiment.

DETAILED DESCRIPTION

Hereinafter, a browser cache is also interchangeably referred to as acache. Any reference to a cache is a reference to a browser cache unlessexpressly distinguished where used.

The illustrative embodiments recognize that a browser cache has to becleaned up from time to time. For example, when new items have to bestored in the browser cache and the browser cache does not havesufficient space to store the new item, some items from the cache haveto be removed—or evicted—from the cache to make room for the new item.The process of removing a cached item from a browser cache is calledcache cleanup.

According to one presently used method for cache cleanup, a browsercache is cleaned up by removing the oldest item in the cache. Forexample, if the browser cache is holding an item that has not been usedin seven days and another item that has not been used in three days, theseven day old item will be evicted before the three day old item isevicted from the browser cache.

Another presently used method cleans up a browser cache by selecting theminimum number of item in the cache whose total size meets the immediatecache space requirement, and removes those selected items. For example,if a new item of size 4 Megabyte (MB) is to be stored in the browsercache, and only 1 MB is available in the browser cache that is holdingone 4 MB item and ten 1 MB items, the single 4 MB item would be evictedinstead of three 1 MB items. Some other methods of browser cache cleanupuse variations of these and other techniques that use similarconsiderations.

The illustrative embodiments recognize that cache cleanup has costconsequences. For example, a user does not incur any cost, or incurssignificantly less cost while using a Wi-Fi network for browsing, ascompared to browsing using a cellular data plan. For example, the usercan browse a website on the user's mobile device at little or no costper byte of transferred data by connecting to the website over a Wi-Finetwork at the user's home. But when the user accesses the same websiteover a data plan associated with the user's mobile device, the user paysa significantly higher per byte cost for transferring data from the samewebsite.

The illustrative embodiments recognize that when a cached item will beused, where the mobile device be located when the cached item will beneeded, and what type of network will be available to download the itemif the item is not cached, are some of the factors that should beconsidered when evicting the cached item. The presently availablemethods for browser cache cleanup are not sensitive to these and othersimilarly purposed cost related factors when selecting cached items foreviction.

The illustrative embodiments used to describe the invention generallyaddress and solve the above-described problems and other problemsrelated to browser cache cleanup. The illustrative embodiments provide amethod, system, and computer program product for cost sensitive browsercache cleanup.

An embodiment executes as an application in, or in conjunction with, adata processing system where a browser application is executing. Anembodiment is particularly useful when implemented in a mobile devicefor cleaning up the browser cache of a mobile browser on the mobiledevice.

One embodiment uses a statistical model to assign weights to variouscached items in a given browser cache. The embodiment selects one ormore cached items to evict based on the weight associated with thecached items. Particularly, the embodiment evicts, or causes to beevicted, the cached item of the lowest weight first. When more than onecached items are to be evicted, the embodiment selects for eviction theitems of progressively increasing weights, starting with the item of thelowest weight, from a sorted order of the cached items according totheir weights.

Another embodiment constructs the statistical model for determining theweight of a particular cached item. One embodiment constructs and trainsthe statistical model—hereinafter also interchangeably referred to asthe model or the weighting model—using a training set of items that werepreviously cached in a given browser cache.

For example, the embodiment accepts as inputs a training cached item, aday of the week and a time when the item was either cached or used fromthe cache (collectively referred to hereinafter as “use” of an item), ageographical location where the device was situated at the day and timeof the use, and a type of network over which the item was obtained forcaching. The embodiment collects the day and time information, thelocation information, and the type of network information from variouscomponents of the device where the embodiment executes. The embodimentassociates such information with the cached items not only for trainingbut for other operations described herein as well.

Using the training item and the associated day, time, location, and typeof network information, the embodiment determines a usage pattern of theitem. For example, a training item may be a cached portion of content ona news website, and the user may visit the new website at approximately8 AM on weekdays from a Wi-Fi network at the user's home. A usagepattern of the training item is therefore each weekday morning, withinan example one hour window around 8 AM, from the user's home location,and over a Wi-Fi network.

The embodiment uses the detected pattern to compute a probability thatthe item will be used during a certain time window or period. Forexample, in the case of above example training item and the usagepattern, the embodiment computes a higher than a threshold probabilitythat the item will be used on a Tuesday morning and a lower than thethreshold probability that the item will be used on a Wednesday eveningor anytime on a Sunday.

The embodiment further identifies a type of network that will beavailable at the device during that certain period. For example, in thecase of above example training item and the usage pattern, theembodiment determines that a Wi-Fi network will likely be availablebetween 7:30 AM and 8:30 AM on a given Tuesday when the item is neededwith higher than threshold probability, a Wi-Fi network—such as a Wi-Finetwork at the user's office—will be available if the item is needed atbelow the threshold probability at 6 PM on a given Wednesday, and acellular data network will be available if the item is needed at belowthe threshold probability anytime on a given Sunday.

Given the size of the training item, the embodiment computes a monetarycost of obtaining the data of the training item over a type of networkthat is applicable during the given period. For example, the cost ofobtaining the training item may be 0.00 Dollars between 7:30 AM and 8:30AM on a given Tuesday over a Wi-Fi network, but the cost of obtainingthe same training item may be 0.07 Dollars between 4:00 PM and 5:00 PMon a given Sunday based on a pricing information of a cellular datanetwork that the device uses.

The embodiment repeats this process for a variety of types of trainingitems, over different days and times, for a variety of time periods, andover different types of networks. Thus, the embodiment trains the modelto recognize statistical patterns of cost of obtaining an item or a typeof item if the item is evicted and has to be re-obtained and re-cachedwhen is needed again. The embodiment further trains the model todetermine a likelihood or probability of needing the item or the type ofitem again during a time period.

The result of the training is a model, which can be represented as afunction of the cost of re-caching and the likelihood of access. Given acached item and the associated day, time, location, and type of networkinformation, the function outputs a weight for the cached item. Thus,when an embodiment evaluates an actual cached item for eviction, thismodel computes a weight of the cached item, which the embodimentassociates with the item for use within a specified period. This weightis then usable for selecting the cached items for eviction in a mannerdescribed in this disclosure.

A method of an embodiment described herein, when implemented to executeon a device or data processing system, comprises substantial advancementof the functionality of that device or data processing system for costsensitive browser cache cleanup. For example, prior-art methods of cachecleanup only consider the size, age, and similar factors for evictingcached items from a browser cache. The prior-art methods of cachecleanup do not take into consideration the monetary cost of re-cachingan item if the item is evicted from the cache. An embodiment evaluatesthe probability that an item, if evicted, will have to be re-obtainedand re-cached at a future time. An embodiment further computes amonetary cost of re-obtaining and re-caching that item should the itembe needed again after eviction. Such manner of cost sensitive browsercache cleanup is unavailable in presently available devices or dataprocessing systems. Thus, a substantial advancement of such devices ordata processing systems by executing a method of an embodiment is inreducing the cost of obtaining data for use in a browser.

The illustrative embodiments are described with respect to certainbrowsers, browser caches, cached items, probabilities, thresholds, timeperiods, weights, types of networks, costs, devices, data processingsystems, environments, components, and applications only as examples.Any specific manifestations of these and other similar artifacts are notintended to be limiting to the invention. Any suitable manifestation ofthese and other similar artifacts can be selected within the scope ofthe illustrative embodiments.

Furthermore, the illustrative embodiments may be implemented withrespect to any type of data, data source, or access to a data sourceover a data network. Any type of data storage device may provide thedata to an embodiment of the invention, either locally at a dataprocessing system or over a data network, within the scope of theinvention. Where an embodiment is described using a mobile device, anytype of data storage device suitable for use with the mobile device mayprovide the data to such embodiment, either locally at the mobile deviceor over a data network, within the scope of the illustrativeembodiments.

The illustrative embodiments are described using specific code, designs,architectures, protocols, layouts, schematics, and tools only asexamples and are not limiting to the illustrative embodiments.Furthermore, the illustrative embodiments are described in someinstances using particular software, tools, and data processingenvironments only as an example for the clarity of the description. Theillustrative embodiments may be used in conjunction with othercomparable or similarly purposed structures, systems, applications, orarchitectures. For example, other comparable mobile devices, structures,systems, applications, or architectures therefor, may be used inconjunction with such embodiment of the invention within the scope ofthe invention. An illustrative embodiment may be implemented inhardware, software, or a combination thereof.

The examples in this disclosure are used only for the clarity of thedescription and are not limiting to the illustrative embodiments.Additional data, operations, actions, tasks, activities, andmanipulations will be conceivable from this disclosure and the same arecontemplated within the scope of the illustrative embodiments.

Any advantages listed herein are only examples and are not intended tobe limiting to the illustrative embodiments. Additional or differentadvantages may be realized by specific illustrative embodiments.Furthermore, a particular illustrative embodiment may have some, all, ornone of the advantages listed above.

With reference to the figures and in particular with reference to FIGS.1 and 2, these figures are example diagrams of data processingenvironments in which illustrative embodiments may be implemented. FIGS.1 and 2 are only examples and are not intended to assert or imply anylimitation with regard to the environments in which differentembodiments may be implemented. A particular implementation may makemany modifications to the depicted environments based on the followingdescription.

FIG. 1 depicts a block diagram of a network of data processing systemsin which illustrative embodiments may be implemented. Data processingenvironment 100 is a network of computers in which the illustrativeembodiments may be implemented. Data processing environment 100 includesnetwork 102. Network 102 is the medium used to provide communicationslinks between various devices and computers connected together withindata processing environment 100. Network 102 may include connections,such as wire, wireless communication links, or fiber optic cables.

Clients or servers are only example roles of certain data processingsystems connected to network 102 and are not intended to exclude otherconfigurations or roles for these data processing systems. Server 104and server 106 couple to network 102 along with storage unit 108.Software applications may execute on any computer in data processingenvironment 100. Clients 110, 112, and 114 are also coupled to network102. A data processing system, such as server 104 or 106, or client 110,112, or 114 may contain data and may have software applications orsoftware tools executing thereon.

Only as an example, and without implying any limitation to sucharchitecture, FIG. 1 depicts certain components that are usable in anexample implementation of an embodiment. For example, servers 104 and106, and clients 110, 112, 114, are depicted as servers and clients onlyas example and not to imply a limitation to a client-serverarchitecture. As another example, an embodiment can be distributedacross several data processing systems and a data network as shown,whereas another embodiment can be implemented on a single dataprocessing system within the scope of the illustrative embodiments. Dataprocessing systems 104, 106, 110, 112, and 114 also represent examplenodes in a cluster, partitions, and other configurations suitable forimplementing an embodiment.

Device 132 is an example of a device described herein. For example,device 132 can take the form of a smartphone, a tablet computer, alaptop computer, client 110 in a stationary or a portable form, awearable computing device, or any other suitable device. Any softwareapplication described as executing in another data processing system inFIG. 1 can be configured to execute in device 132 in a similar manner.Any data or information stored or produced in another data processingsystem in FIG. 1 can be configured to be stored or produced in device132 in a similar manner.

Application 134 executes in device 132 and implements an embodimentdescribed herein. Browser 135 uses browser cache 136 in device 132. Forexample, server 104 provides content 105 to browser 135. Browser 135caches a portion of content 105 in browser cache 136 as a cached item.Similarly, server 106 provides content 107 to browser 135. Browser 135caches all or a portion of content 107 in browser cache 136 as one ormore different cached items. Application 134 operates to select a cacheditem in browser cache 136 for eviction from browser cache 136. Accordingto one embodiment, application 134 evicts the selected cached item orcauses the selected cached item to be evicted from browser cache 136.

Servers 104 and 106, storage unit 108, and clients 110, 112, and 114 maycouple to network 102 using wired connections, wireless communicationprotocols, or other suitable data connectivity. Clients 110, 112, and114 may be, for example, personal computers or network computers.

In the depicted example, server 104 may provide data, such as bootfiles, operating system images, and applications to clients 110, 112,and 114. Clients 110, 112, and 114 may be clients to server 104 in thisexample. Clients 110, 112, 114, or some combination thereof, may includetheir own data, boot files, operating system images, and applications.Data processing environment 100 may include additional servers, clients,and other devices that are not shown.

In the depicted example, data processing environment 100 may be theInternet. Network 102 may represent a collection of networks andgateways that use the Transmission Control Protocol/Internet Protocol(TCP/IP) and other protocols to communicate with one another. At theheart of the Internet is a backbone of data communication links betweenmajor nodes or host computers, including thousands of commercial,governmental, educational, and other computer systems that route dataand messages. Of course, data processing environment 100 also may beimplemented as a number of different types of networks, such as forexample, an intranet, a local area network (LAN), or a wide area network(WAN). FIG. 1 is intended as an example, and not as an architecturallimitation for the different illustrative embodiments.

Among other uses, data processing environment 100 may be used forimplementing a client-server environment in which the illustrativeembodiments may be implemented. A client-server environment enablessoftware applications and data to be distributed across a network suchthat an application functions by using the interactivity between aclient data processing system and a server data processing system. Dataprocessing environment 100 may also employ a service orientedarchitecture where interoperable software components distributed acrossa network may be packaged together as coherent business applications.

With reference to FIG. 2, this figure depicts a block diagram of a dataprocessing system in which illustrative embodiments may be implemented.Data processing system 200 is an example of a computer, such as servers104 and 106, or clients 110, 112, and 114 in FIG. 1, or another type ofdevice in which computer usable program code or instructionsimplementing the processes may be located for the illustrativeembodiments.

Data processing system 200 is also representative of a data processingsystem or a configuration therein, such as data processing system 132 inFIG. 1 in which computer usable program code or instructionsimplementing the processes of the illustrative embodiments may belocated. Data processing system 200 is described as a computer only asan example, without being limited thereto. Implementations in the formof other devices, such as device 132 in FIG. 1, may modify dataprocessing system 200, such as by adding a touch interface, and eveneliminate certain depicted components from data processing system 200without departing from the general description of the operations andfunctions of data processing system 200 described herein.

In the depicted example, data processing system 200 employs a hubarchitecture including North Bridge and memory controller hub (NB/MCH)202 and South Bridge and input/output (I/O) controller hub (SB/ICH) 204.Processing unit 206, main memory 208, and graphics processor 210 arecoupled to North Bridge and memory controller hub (NB/MCH) 202.Processing unit 206 may contain one or more processors and may beimplemented using one or more heterogeneous processor systems.Processing unit 206 may be a multi-core processor. Graphics processor210 may be coupled to NB/MCH 202 through an accelerated graphics port(AGP) in certain implementations.

In the depicted example, local area network (LAN) adapter 212 is coupledto South Bridge and I/O controller hub (SB/ICH) 204. Audio adapter 216,keyboard and mouse adapter 220, modem 222, read only memory (ROM) 224,universal serial bus (USB) and other ports 232, and PCI/PCIe devices 234are coupled to South Bridge and I/O controller hub 204 through bus 238.Hard disk drive (HDD) or solid-state drive (SSD) 226 and CD-ROM 230 arecoupled to South Bridge and I/O controller hub 204 through bus 240.PCI/PCIe devices 234 may include, for example, Ethernet adapters, add-incards, and PC cards for notebook computers. PCI uses a card buscontroller, while PCIe does not. ROM 224 may be, for example, a flashbinary input/output system (BIOS). Hard disk drive 226 and CD-ROM 230may use, for example, an integrated drive electronics (IDE), serialadvanced technology attachment (SATA) interface, or variants such asexternal-SATA (eSATA) and micro-SATA (mSATA). A super I/O (SIO) device236 may be coupled to South Bridge and I/O controller hub (SB/ICH) 204through bus 238.

Memories, such as main memory 208, ROM 224, or flash memory (not shown),are some examples of computer usable storage devices. Hard disk drive orsolid state drive 226, CD-ROM 230, and other similarly usable devicesare some examples of computer usable storage devices including acomputer usable storage medium.

An operating system runs on processing unit 206. The operating systemcoordinates and provides control of various components within dataprocessing system 200 in FIG. 2. The operating system may be acommercially available operating system such as AIX® (AIX is a trademarkof International Business Machines Corporation in the United States andother countries), Microsoft® Windows® (Microsoft and Windows aretrademarks of Microsoft Corporation in the United States and othercountries), Linux® (Linux is a trademark of Linus Torvalds in the UnitedStates and other countries), iOS™ (iOS is a trademark of Cisco Systems,Inc. licensed to Apple Inc. in the United States and in othercountries), or Android™ (Android is a trademark of Google Inc., in theUnited States and in other countries). An object oriented programmingsystem, such as the Java™ programming system, may run in conjunctionwith the operating system and provide calls to the operating system fromJava™ programs or applications executing on data processing system 200(Java and all Java-based trademarks and logos are trademarks orregistered trademarks of Oracle Corporation and/or its affiliates).

Instructions for the operating system, the object-oriented programmingsystem, and applications or programs, such as application 134 in FIG. 1,are located on storage devices, such as hard disk drive 226, and may beloaded into at least one of one or more memories, such as main memory208, for execution by processing unit 206. The processes of theillustrative embodiments may be performed by processing unit 206 usingcomputer implemented instructions, which may be located in a memory,such as, for example, main memory 208, read only memory 224, or in oneor more peripheral devices.

The hardware in FIGS. 1-2 may vary depending on the implementation.Other internal hardware or peripheral devices, such as flash memory,equivalent non-volatile memory, or optical disk drives and the like, maybe used in addition to or in place of the hardware depicted in FIGS.1-2. In addition, the processes of the illustrative embodiments may beapplied to a multiprocessor data processing system.

In some illustrative examples, data processing system 200 may be apersonal digital assistant (PDA), which is generally configured withflash memory to provide non-volatile memory for storing operating systemfiles and/or user-generated data. A bus system may comprise one or morebuses, such as a system bus, an I/O bus, and a PCI bus. Of course, thebus system may be implemented using any type of communications fabric orarchitecture that provides for a transfer of data between differentcomponents or devices attached to the fabric or architecture.

A communications unit may include one or more devices used to transmitand receive data, such as a modem or a network adapter. A memory may be,for example, main memory 208 or a cache, such as the cache found inNorth Bridge and memory controller hub 202. A processing unit mayinclude one or more processors or CPUs.

The depicted examples in FIGS. 1-2 and above-described examples are notmeant to imply architectural limitations. For example, data processingsystem 200 also may be a tablet computer, laptop computer, or telephonedevice in addition to taking the form of a mobile or wearable device.

With reference to FIG. 3, this figure depicts a block diagram of anexample progression in a process for cost sensitive browser cachecleanup in accordance with an illustrative embodiment. Application 302is an example of application 134 in FIG. 1. Browser cache 304 is anexample of browser cache 136 in FIG. 1, and is shown in different statesat different times T1, T2, and T3.

As an example, at time T1, cache 304 includes cached item 1 (item 1),cached item 2 (item 2), and similarly any number of cached items throughcached item n (item n). Application 302 includes cached item weightingmodel 306, which evaluates cached items in cache 304 and computesweights corresponding to those cached items.

For example, at time T2, by the operation of model 306 in application302 in a manner described herein, application 302 associates weight 1with item 1, weight 2 with item 2, and so on until weight n with item n.Note that not all cached items need to be weighted in this manner. Forexample, some cached items may be designated for special or differenttreatment, such as for permanent caching without eviction or foreviction according to different rules. According to one embodiment, suchcached items can be omitted from the evaluation by model 306, andapplication 302 may omit assigning them weights and selecting them foreviction.

Furthermore, the weights associated with the cached items are depictedas located within cache 304 only as a non-limiting example. In oneembodiment, application 302 stores the weight data of a cached item incache 304. In another embodiment, application 302 stores the weight dataof a cached item in a location other than cache 304. For example,application 302 can be configured to maintain a table, list, or otherdata structure (not shown) to hold the identifiers of the cached itemsand their corresponding weights. Such a data structure can be stored inany suitable storage device configured for use with the device whereapplication 302 is executing, including but not limited to use as cache304.

At time T3, application removes, or causes to be removed, from cache304, a cached item of the lowest weight. For example, assume that weight2 associated with item 2 is the lowest amongst weights 1 through n ofitems 1 through n in cache 304. Accordingly, application 302 selects ordesignates item 2 for eviction from cache 304.

With reference to FIG. 4, this figure depicts a block diagram of anexample configuration of an application for cost sensitive browser cachecleanup in accordance with an illustrative embodiment. Application 402is an example of application 302 in FIG. 3. Cached item 404 is anexample of any of items 1 through n at time T1 in cache 304 in FIG. 3.Model 406 is an example of model 306 in FIG. 3.

In a manner described in this disclosure, model 406 has been trainedpreviously to compute likelihood (probability) of access of variousitems or types of items that have been cached in the device whereapplication 402 is executing, such as in cache 304 in FIG. 3. For cacheditem 404, component 408 computes a likelihood that item 404 will beaccessed during specified period 405.

Component 410 computes a cost of obtaining the data of cached item 404from a location and over a type of network that will be available duringperiod 405.

In some cases, the period can be specified, such as in FIG. 4, whereperiod 405 is depicted as an input. In other cases, a pattern of usageof an item can itself reveal a period when the item can be expected tobe used. Recall the example of the user visiting a news website onweekdays mornings. The user can similarly have patterns of visits to afinancial website during weekdays afternoons, a sports website duringgame season evenings, a political website during weekday evenings, ahobby-related website at various times during the weekends.

Accordingly, items cached from the news information sources, thefinancial information sources, the sports websites, the politicalinformation sources, and the hobby-related sources each can be used topredict a period when an item from any one of those sources will beneeded next. For example, if an item from a news website is evicted on aweekday, it will likely be needed again on the next weekday morningduring a period when the user visits the news website. Similarly, if anitem from the hobby-related website is evicted on a weekday, it willlikely not be needed until a period in the next weekend. But, if an itemfrom the hobby-related website is evicted on a Saturday, it will likelybe needed again during a period later on Saturday.

Using the outputs of components 408 and 410, model 406 produces, andapplication 402 outputs weight 412. Application 402 associates weight412 with item 404.

With reference to FIG. 5, this figure depicts a block diagram of anexample process for training a cached item weighting model in accordancewith an illustrative embodiment. Model training process 500 producesmodel 506. Model 506 is usable as model 406 in FIG. 4.

Model training process 500 receives as input any number of sets oftraining item information. A set of training item information includestraining item 512, which is a previously cached item from a browsercache at the device where model 506 will execute. Training item 512 hasa type (not shown), and many different training items 512 may share acommon type.

The set of training item information further includes day of the weekand time 514 when training item 512 was used, location of 516 the devicewhen training item 512 was used, and type of network 518. Type ofnetwork 518 is a type of network over which training item 518 wasreceived at the device, or a type of network that was available to thedevice when training item was used.

Using a set of training item information, process 500 determines (520) ausage pattern of training item 512. For example, given many sets oftraining item information, several sets may include the same trainingitem with different combinations of days, times, locations, and types ofnetworks information, and such different combinations are usable forstatistically determining a usage pattern for training item 512.

Process 500 computes (522) a probability that training item 512 will beused during a given period. The period may be a period that has alreadyelapsed and from which at least some of the sets of training iteminformation have been generated.

Process 500 identifies (524) the type of network that is likely to beavailable at the given period according to the usage pattern. Process500 computes (526) a cost of caching the item over the identified typeof network. For example, process 500 computes the cost at step 526 byusing a price schedule (not shown) for using the network. A user maysupply the price schedule, a default price schedule for some types ofnetworks may be pre-configured, process 500 may obtain a price schedule,such as from a service provider, or some combination thereof.

By performing steps 520-526 in this manner over a plurality of sets oftraining item information, process 500 produces model 506. Model 506includes, but is not limited to, at least two factors using which aweight of an actual cached item can be computed in a manner described inthis disclosure. One of the factors (528) is a cost of re-caching anitem or a type of item during a period if the item or the type of itemis evicted from a browser cache. Another factor (530) is a likelihood orprobability that an item or a type of item will be needed or accessedover a network during the period.

With reference to FIG. 6, this figure depicts a flowchart of an exampleprocess for cost sensitive browser cache cleanup in accordance with anillustrative embodiment. Process 600 can be implemented in application402 in FIG. 4.

The application detects a condition that has to be remedied through abrowser cache cleanup (block 602). One example condition may be that thebrowser cache usage has exceeded a preset usage threshold and somecached items have to be evicted. Another example condition may be thatthe browser is reporting an unacceptable latency because of insufficientcache space, and some cached items have to be evicted to allow thebrowser to store new cache items.

The application selects an item that is present in the browser cache(block 604). Using a pattern of usage of the item or the type of theitem, according to a weighting model, the application determines aperiod during which the item is likely to be needed again (block 606).In some cases, the period can be specified, such as in FIG. 4, whereperiod 405 was described as an input. In other cases, as describedelsewhere in this disclosure, a pattern of usage of an item can itselfreveal a period when the item can be expected to be used.

Using the pattern of usage of the item or the type of the item, from themodel, the application determines a likelihood of needing the itemduring the determined or supplied period (block 608). For example, anitem may be from a news website, but it may be a website that the uservisits only occasionally, such as once or twice every week. Another itemmay be from another news website which the user visits regularly, suchas every weekday morning. Other considerations in making thisdetermination notwithstanding, the likelihood that the first item willbe needed during a particular period on a weekday morning is going to beless than the likelihood that the second item will be needed during thesame period. Furthermore, one or both probabilities may be below athreshold probability, or meet or exceed the threshold probability.

Using the model, the application identifies a type of network that willbe available to the device, or is most likely to be used, when the itemhas to be re-obtained from a source during the period (block 610). Theapplication determines a cost incurred by using the identified type ofnetwork to obtain the item again during the period of block 606 (block612). Re-caching is the obtaining an item over a network and storing theitem into a browser cache. Because the only network cost is in obtainingthe item over a network, and storing an item into a cache does not incurany network costs, the cost of obtaining the item over a network isinterchangeably referred to as a cost of re-caching the item whendiscussing costs of an item in this disclosure.

Using the probability of needing the item again during a period afterthe selected item has been evicted, and using the cost of re-caching theitem, the application computes a weight for the selected item (block614). The application assigns the computed weight to the selected item(block 616).

The application determines whether more items remain in the cache thathave to be weighted in this manner (block 618). If more items have to beweighted (“Yes” path of block 618), the application returns process 600to block 604 to select another item. If no more items have to beweighted (“No” path of block 618), the application selects the lowestweighted item in the cache (block 620). The application selects foreviction, evicts, or causes to be evicted, the lowest weighted item(block 622).

The application determines if more cache cleanup is needed by evictingmore items from the cache (block 624). If more cache cleanup is needed(“Yes” path of block 624), the application returns process 600 to block620 to select from the remaining weighted items the remaining lowestweighted item. If no more cache cleanup is needed (“No” path of block624), the application ends process 600 thereafter.

Thus, a computer implemented method, system or apparatus, and computerprogram product are provided in the illustrative embodiments for costsensitive browser cache cleanup. Where an embodiment or a portionthereof is described with respect to a type of device, the computerimplemented method, system or apparatus, the computer program product,or a portion thereof, are adapted or configured for use with a suitableand comparable manifestation of that type of device.

The present invention may be a system, a method, and/or a computerprogram product. The computer program product may include a computerreadable storage medium (or media) having computer readable programinstructions thereon for causing a processor to carry out aspects of thepresent invention.

The computer readable storage medium can be a tangible device that canretain and store instructions for use by an instruction executiondevice. The computer readable storage medium may be, for example, but isnot limited to, an electronic storage device, a magnetic storage device,an optical storage device, an electromagnetic storage device, asemiconductor storage device, or any suitable combination of theforegoing. A non-exhaustive list of more specific examples of thecomputer readable storage medium includes the following: a portablecomputer diskette, a hard disk, a random access memory (RAM), aread-only memory (ROM), an erasable programmable read-only memory (EPROMor Flash memory), a static random access memory (SRAM), a portablecompact disc read-only memory (CD-ROM), a digital versatile disk (DVD),a memory stick, a floppy disk, a mechanically encoded device such aspunch-cards or raised structures in a groove having instructionsrecorded thereon, and any suitable combination of the foregoing. Acomputer readable storage medium, as used herein, is not to be construedas being transitory signals per se, such as radio waves or other freelypropagating electromagnetic waves, electromagnetic waves propagatingthrough a waveguide or other transmission media (e.g., light pulsespassing through a fiber-optic cable), or electrical signals transmittedthrough a wire.

Computer readable program instructions described herein can bedownloaded to respective computing/processing devices from a computerreadable storage medium or to an external computer or external storagedevice via a network, for example, the Internet, a local area network, awide area network and/or a wireless network. The network may comprisecopper transmission cables, optical transmission fibers, wirelesstransmission, routers, firewalls, switches, gateway computers and/oredge servers. A network adapter card or network interface in eachcomputing/processing device receives computer readable programinstructions from the network and forwards the computer readable programinstructions for storage in a computer readable storage medium withinthe respective computing/processing device.

Computer readable program instructions for carrying out operations ofthe present invention may be assembler instructions,instruction-set-architecture (ISA) instructions, machine instructions,machine dependent instructions, microcode, firmware instructions,state-setting data, or either source code or object code written in anycombination of one or more programming languages, including an objectoriented programming language such as Smalltalk, C++ or the like, andconventional procedural programming languages, such as the “C”programming language or similar programming languages. The computerreadable program instructions may execute entirely on the user'scomputer, partly on the user's computer, as a stand-alone softwarepackage, partly on the user's computer and partly on a remote computeror entirely on the remote computer or server. In the latter scenario,the remote computer may be connected to the user's computer through anytype of network, including a local area network (LAN) or a wide areanetwork (WAN), or the connection may be made to an external computer(for example, through the Internet using an Internet Service Provider).In some embodiments, electronic circuitry including, for example,programmable logic circuitry, field-programmable gate arrays (FPGA), orprogrammable logic arrays (PLA) may execute the computer readableprogram instructions by utilizing state information of the computerreadable program instructions to personalize the electronic circuitry,in order to perform aspects of the present invention.

Aspects of the present invention are described herein with reference toflowchart illustrations and/or block diagrams of methods, apparatus(systems), and computer program products according to embodiments of theinvention. It will be understood that each block of the flowchartillustrations and/or block diagrams, and combinations of blocks in theflowchart illustrations and/or block diagrams, can be implemented bycomputer readable program instructions.

These computer readable program instructions may be provided to aprocessor of a general purpose computer, special purpose computer, orother programmable data processing apparatus to produce a machine, suchthat the instructions, which execute via the processor of the computeror other programmable data processing apparatus, create means forimplementing the functions/acts specified in the flowchart and/or blockdiagram block or blocks. These computer readable program instructionsmay also be stored in a computer readable storage medium that can directa computer, a programmable data processing apparatus, and/or otherdevices to function in a particular manner, such that the computerreadable storage medium having instructions stored therein comprises anarticle of manufacture including instructions which implement aspects ofthe function/act specified in the flowchart and/or block diagram blockor blocks.

The computer readable program instructions may also be loaded onto acomputer, other programmable data processing apparatus, or other deviceto cause a series of operational steps to be performed on the computer,other programmable apparatus or other device to produce a computerimplemented process, such that the instructions which execute on thecomputer, other programmable apparatus, or other device implement thefunctions/acts specified in the flowchart and/or block diagram block orblocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods, and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof instructions, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the block may occur out of theorder noted in the figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. It will also be noted that each block of theblock diagrams and/or flowchart illustration, and combinations of blocksin the block diagrams and/or flowchart illustration, can be implementedby special purpose hardware-based systems that perform the specifiedfunctions or acts or carry out combinations of special purpose hardwareand computer instructions.

1-8. (canceled)
 9. A computer usable program product comprising acomputer readable storage device including computer usable code forbrowser cache cleanup, the computer usable code comprising: computerusable code for computing, using a processor and a memory of a device,to consider for eviction a data item stored in a cache of a browserapplication, a probability that the data item will be needed againduring a period after the eviction; computer usable code for determininga type of a data network that will be available at the device during theperiod; computer usable code for computing, a cost of obtaining the dataitem over a data network of the type of data network, from a location ofthe device during the period; computer usable code for computing, usingthe probability that the data item will be needed again during theperiod, and further using the cost of obtaining the data item over thedata network, a weight of the data item; computer usable code forassociating the weight with the data item as a part of associating a setof weights with a set of data items in the cache; and computer usablecode for selecting for eviction from the cache the data item because theweight is a lowest weight in the set of weights.
 10. The computer usableprogram product of claim 9, further comprising: computer usable code fordetermining, using a set of historical data item information, ahistorical usage pattern of the data item, wherein each member in theset of historical data item information comprises the data item and acombination of a particular day and time when the data item was used inpast, a particular location from where the data item was used at theparticular day and time, and a particular type of network available atthe device at the particular location at the particular day and time;computer usable code for constructing a weighting model using thehistorical usage pattern, wherein the weighting model produces theprobability that the data item will be needed again during the period,and the cost of obtaining the data item over the data network; andcomputer usable code for using, as a part of computing the weight, theweighting model.
 11. The computer usable program product of claim 9,wherein the cost is a monetary cost that is financially incurred fromthe data network.
 12. The computer usable program product of claim 9,further comprising: computer usable code for using, in computing thecost, a pricing information for performing a data transfer over the datanetwork during the period from the location.
 13. The computer usableprogram product of claim 9, further comprising: computer usable code fordetermining the location using a historical usage pattern of the dataitem, wherein the location according to the historical usage pattern isa geographical place where the device was situated in past during a useof the data item.
 14. The computer usable program product of claim 9,further comprising: computer usable code for detecting a condition thatan amount of storage space has to be reclaimed in the cache, wherein thecondition comprises a utilization of the cache exceeding a utilizationthreshold.
 15. The computer usable program product of claim 9, furthercomprising: computer usable code for determining the period using ahistorical usage pattern of the data item, wherein the historical usagepattern is indicative of a day of week and time duration during whichthe data item has been used in past, wherein the period comprises thetime duration in the day of week in future.
 16. The computer usableprogram product of claim 9, wherein the device is a mobile device, thebrowser is a mobile browser, and the cache is a portion of a storagedevice configured for use with the mobile device.
 17. The computerusable program product of claim 9, wherein the computer usable code isstored in a computer readable storage device in a data processingsystem, and wherein the computer usable code is transferred over anetwork from a remote data processing system.
 18. The computer usableprogram product of claim 9, wherein the computer usable code is storedin a computer readable storage device in a server data processingsystem, and wherein the computer usable code is downloaded over anetwork to a remote data processing system for use in a computerreadable storage device associated with the remote data processingsystem.
 19. A data processing system for browser cache cleanup, the dataprocessing system comprising: a storage device, wherein the storagedevice stores computer usable program code; and a processor, wherein theprocessor executes the computer usable program code, and wherein thecomputer usable program code comprises: computer usable code forcomputing, using a processor and a memory of a device, to consider foreviction a data item stored in a cache of a browser application, aprobability that the data item will be needed again during a periodafter the eviction; computer usable code for determining a type of adata network that will be available at the device during the period;computer usable code for computing, a cost of obtaining the data itemover a data network of the type of data network, from a location of thedevice during the period; computer usable code for computing, using theprobability that the data item will be needed again during the period,and further using the cost of obtaining the data item over the datanetwork, a weight of the data item; computer usable code for associatingthe weight with the data item as a part of associating a set of weightswith a set of data items in the cache; and computer usable code forselecting for eviction from the cache the data item because the weightis a lowest weight in the set of weights.
 20. The data processing systemof claim 19, further comprising: computer usable code for determining,using a set of historical data item information, a historical usagepattern of the data item, wherein each member in the set of historicaldata item information comprises the data item and a combination of aparticular day and time when the data item was used in past, aparticular location from where the data item was used at the particularday and time, and a particular type of network available at the deviceat the particular location at the particular day and time; computerusable code for constructing a weighting model using the historicalusage pattern, wherein the weighting model produces the probability thatthe data item will be needed again during the period, and the cost ofobtaining the data item over the data network; and computer usable codefor using, as a part of computing the weight, the weighting model.